package com.cm.caseManagement.service.impl;


import com.cm.caseManagement.service.ICmCaseDetailsService;
import com.cm.caseManagement.service.ICmCaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 案件详情Service业务层处理
 *
 * @author ruoyi
 * @date 2025-10-05
 */
@Service
public class CmCaseDetailsServiceImpl implements ICmCaseDetailsService {

    @Autowired
    private ICmCaseService cmCaseService;

    /**
     * 根据案件id获取案件阶段
     * @param id
     * @return
     */
    @Override
    public String[] getCaseStageById(Long id) {
        String caseStage = cmCaseService.selectCmCaseById(id).getCaseStage();
        switch (caseStage){
            case "委托":
                return new String[]{"全部","委托"};
            case "诉前":
                return new String[]{"全部","委托","诉前"};
            case "诉讼":
                return new String[]{"全部","委托","诉前","诉讼"};
            case "已判未执行":
                return new String[]{"全部","委托","诉前","诉讼","已判未执行"};
            case "执行":
                return new String[]{"全部","委托","诉前","诉讼","已判未执行","执行"};
            default:
                return new String[]{"全部"};
        }
    }
}
